package io.renren.controller;

/**
 * describe:
 * create @ kylin  2019/03/03
 */

import io.renren.entity.CategoryEntity;
import io.renren.entity.Result;
import io.renren.service.CategoryService;
import io.renren.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 分类(若干子功能)
 *
 * @author kylin
 * @email 1360315221@qq.com
 * @date 2019-03-03 20:44:03
 */
@Api(tags="分类")
@RestController
@RequestMapping("/api/category")
public class ApiCategoryController {
    @Autowired
    private CategoryService categoryService;


    @ApiOperation(value = "获取分类列表")
    @GetMapping(value = "/list")
    public Result<CategoryEntity> list() throws Exception {
        return ResultUtil.success(this.categoryService.getAllList());
    }


}
